﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.Data
{
    [Serializable]
   public  class DSVectorGrid3d
    {

        public DSVectorGrid3d()
        {

            this._collecion = new List<CellCenterVector3dDS>();

            this._name = "流动向量";
        }



        string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }




        double _minVectorValue = 0;
        /// <summary>
        /// 向量的模的最小值
        /// </summary>
        public double MinVectorValue
        {
            get { return _minVectorValue; }
            //set { _minVectorValue = value; }
        }


        double _maxVectorValue = 0;
        /// <summary>
        /// 向量的模的最大值
        /// </summary>
        public double MaxVectorValue
        {
            get { return _maxVectorValue; }
            //set { _maxVectorValue = value; }
        }






        public bool IsMultiDataset
        {

            get
            {

                if (_collecion.Count > 1)
                {
                    return true;

                }

                else
                {
                    return false;
                }
            }

        }


        List<CellCenterVector3dDS> _collecion;

        public List<CellCenterVector3dDS> Collecion
        {
            get { return _collecion; }
          
        }


        public int Count
        {
            get { return this._collecion.Count; }
        }


        /// <summary>
        /// 用于公共存储数据
        /// </summary>
        /// <param name="datas"></param>
        public void ResetData(List<CellCenterVector3dDS> datas)

        {

            this._collecion.Clear();

            this._collecion.AddRange(datas);



            if (datas !=null )
            {
                for (int i = 0; i < datas.Count ; i++)
                {

                    if (datas[i]!=null )
                    {

                        if (datas[i].MinValue < this._minVectorValue)
                        {
                            this._minVectorValue = datas[i].MinValue;

                        }
                        if (datas[i].MaxValue > this._maxVectorValue)
                        {
                            this._maxVectorValue = datas[i].MaxValue;
                        }

                    }
                }
            }



        }


        public CellCenterVector3dDS GetDataSet(int index)
        {
            if (this._collecion.Count > index)
            {

                return this._collecion[index];

            }

            return null;

        }



    }
}
